<html lang="en">
<head>
    <meta charset="UTF-8">
    <!-- 这个地方必须得引入，否则会出现页面可缩放的问题-->
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
    <title>PullDownWithTab</title>
    <!-- weui的相关css样式，需要引入-->
    <link rel="stylesheet" href="../css/weui.min.css">
    <link rel="stylesheet" href="../css/jquery-weui.min.css">
</head>
<body>

<div class="weui-tab">
    <div class="weui-navbar">
        <div class="weui-navbar__item weui-navbar__item--on weui-bar__item--on" href="#tab1">
            选项一
        </div>
        <div class="weui-navbar__item" href="#tab2">
            选项二
        </div>
        <div class="weui-navbar__item" href="#tab3">
            选项三
        </div>
    </div>

    <div class="weui-tab__bd">
        <div class="weui-tab__bd-item weui-tab__bd-item--active weui-pull-to-refresh" id="tab1">
            <div class="weui-pull-to-refresh__layer">
                <div class="weui-pull-to-refresh__arrow"></div>
                <div class="weui-pull-to-refresh__preloader"></div>
                <div class="down">下拉刷新</div>
                <div class="up">释放刷新</div>
                <div class="refresh">正在刷新</div>
            </div>
            <h1 class="doc-head">页面一</h1>
            <div class="content-padded">
                <p>jQuery API - jQuery is a fast, small, and feature-rich JavaScript library. It makes things like HTML
                    document traversal and manipulation, event handling, animation, and Ajax much simpler with an
                    easy-to-use API that works across a multitude of browsers. If you're new to jQuery, we recommend
                    that you check out the jQuery Learning Center.</p>
                <p>jQuery API - jQuery is a fast, small, and feature-rich JavaScript library. It makes things like HTML
                    document traversal and manipulation, event handling, animation, and Ajax much simpler with an
                    easy-to-use API that works across a multitude of browsers. If you're new to jQuery, we recommend
                    that you check out the jQuery Learning Center.</p>
                <p>jQuery API - jQuery is a fast, small, and feature-rich JavaScript library. It makes things like HTML
                    document traversal and manipulation, event handling, animation, and Ajax much simpler with an
                    easy-to-use API that works across a multitude of browsers. If you're new to jQuery, we recommend
                    that you check out the jQuery Learning Center.</p>
            </div>
        </div>
        <div class="weui-tab__bd-item weui-pull-to-refresh" id="tab2">
            <div class="weui-pull-to-refresh__layer">
                <div class="weui-pull-to-refresh__arrow"></div>
                <div class="weui-pull-to-refresh__preloader"></div>
                <div class="down">下拉刷新</div>
                <div class="up">释放刷新</div>
                <div class="refresh">正在刷新</div>
            </div>
            <h1 class="doc-head">页面二</h1>
            <div class="content-padded">
                <p>jQuery API - jQuery is a fast, small, and feature-rich JavaScript library. It makes things like HTML
                    document traversal and manipulation, event handling, animation, and Ajax much simpler with an
                    easy-to-use API that works across a multitude of browsers. If you're new to jQuery, we recommend
                    that you check out the jQuery Learning Center.</p>
                <p>jQuery API - jQuery is a fast, small, and feature-rich JavaScript library. It makes things like HTML
                    document traversal and manipulation, event handling, animation, and Ajax much simpler with an
                    easy-to-use API that works across a multitude of browsers. If you're new to jQuery, we recommend
                    that you check out the jQuery Learning Center.</p>
                <p>jQuery API - jQuery is a fast, small, and feature-rich JavaScript library. It makes things like HTML
                    document traversal and manipulation, event handling, animation, and Ajax much simpler with an
                    easy-to-use API that works across a multitude of browsers. If you're new to jQuery, we recommend
                    that you check out the jQuery Learning Center.</p>
            </div>
        </div>
        <div class="weui-tab__bd-item weui-pull-to-refresh" id="tab3">
            <div class="weui-pull-to-refresh__layer">
                <div class="weui-pull-to-refresh__arrow"></div>
                <div class="weui-pull-to-refresh__preloader"></div>
                <div class="down">下拉刷新</div>
                <div class="up">释放刷新</div>
                <div class="refresh">正在刷新</div>
            </div>
            <h1 class="doc-head">页面三</h1>
            <div class="content-padded">
                <p>jQuery API - jQuery is a fast, small, and feature-rich JavaScript library. It makes things like HTML
                    document traversal and manipulation, event handling, animation, and Ajax much simpler with an
                    easy-to-use API that works across a multitude of browsers. If you're new to jQuery, we recommend
                    that you check out the jQuery Learning Center.</p>
                <p>jQuery API - jQuery is a fast, small, and feature-rich JavaScript library. It makes things like HTML
                    document traversal and manipulation, event handling, animation, and Ajax much simpler with an
                    easy-to-use API that works across a multitude of browsers. If you're new to jQuery, we recommend
                    that you check out the jQuery Learning Center.</p>
                <p>jQuery API - jQuery is a fast, small, and feature-rich JavaScript library. It makes things like HTML
                    document traversal and manipulation, event handling, animation, and Ajax much simpler with an
                    easy-to-use API that works across a multitude of browsers. If you're new to jQuery, we recommend
                    that you check out the jQuery Learning Center.</p>
            </div>
        </div>
    </div>
</div>



<script src="../js/jquery.min.js"></script>
<script src="../js/jquery-weui.min.js"></script>
<script>

    $('.weui-tab__bd-item').pullToRefresh().on('pull-to-refresh', function (done) {
        var self = this
        setTimeout(function () {
            $(self).pullToRefreshDone();
        }, 2000)
    })
</script>
</body>
</html>